<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/pub/includ.jsp"%>
<%@ page import="com.wing.sys.domain.Module" %>
<%@ include file="/pub/tree_common.jsp"%>
<HTML>
<HEAD>
<title>功能区</title>
</head>

<body>
<div class="sidebar_img">功能区</div>
<div class="sidebar">
	

    <div id="treeObject" ></div>
<script type="text/javascript">
    tree=new dhtmlXTreeObject('treeObject',"100%","100%",0); 
    tree.setOnClickHandler(doOnClick); 
    tree.setImagePath("<%=xtreePath%>"); 
    tree.enableDragAndDrop(false);   
    tree.setXMLAutoLoading("<%=path%>/sys/module/showTree?menu=true");
    //tree.enableCheckBoxes(1);
    //tree.enableThreeStateCheckboxes(true); 
    //tree.enableRadioButtons(true);
    //tree.setOnDblClickHandler(doOnDblClick);
    //tree.enableHighlighting(true);
    //tree.enableTreeLines(false);
	//tree.setItemTopOffset('-1',0);
	//tree.setOnLoadingEnd(doOnClick);
    tree.loadXML("<%=path%>/sys/module/showTree?menu=true");
    function doOnClick(nodeId){
		if(nodeId != null){
			$.get("<%=path%>/sys/getm/"+nodeId, function(data) {
				var url = data.url;
				var link_type = data.link_type;
				go(link_type,url);
			});
		}
	}

	function go(link_type,url){
		if(url!=""){
			if("<%=Module.LINKTYPE_OTHER %>"!=link_type){
		  		parent.ifrmMain.location="<%=path%>"+url;
			}else{
				top.window.open(url);
			}
		}
	}
	//function doOnDblClick(nodeId){
	//	alert(nodeId);
	//	return false;
	//}
	function refreshItem(nodeId){
		tree.refreshItem(nodeId);
		tree.focusItem(nodeId);
	}
	function deleteItem(nodeId){
		tree.deleteItem(nodeId);
	}
</script>
</div>
</body>
</html>
